﻿using B.S.BaseData.ErrorCode;
using B.S.DataBase.EFCoreServiers.Dtos.Depts;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace B.S.DataBase.EFCoreServiers.IServices.Dtpes
{
    public interface IDepartmentServices
    {
        /// <summary>
        /// 添加部门
        /// </summary>
        /// <param name="departmentDto">部门数据传输对象</param>
        /// <returns>操作结果</returns>
         Task<ApiResult> AddDepartmentAsync(AddDepartmentDto departmentDto);
        /// <summary>
        /// 获取部门列表
        /// </summary>
        /// <param name="departmentDto">查询参数</param>
        /// <returns>部门列表分页结果</returns>
        Task<ApiResult<ApiPaging<GetDepartmentResponseDto>>> GetDepartmentListAsync(GetDepartmentDto departmentDto);
        /// <summary>
        /// 更新部门信息
        /// </summary>
        /// <param name="departmentDto">更新的部门数据传输对象</param>
        /// <returns>操作结果</returns>
        Task<ApiResult> UpdateDepartmentAsync(UpdateDepartmentDto departmentDto);
        
        /// <summary>
        /// 删除部门
        /// </summary>
        /// <param name="deptId">部门ID</param>
        /// <returns>操作结果</returns>
        Task<ApiResult> DeleteDepartmentAsync(int deptId);
        /// <summary>
        /// 部门树形结构
        /// </summary>
        /// <param name="ParentId"></param>
        /// <returns></returns>
        Task<ApiResult<IList<DeptItemTree>>> GetDeptTree(int ParentId = 0);
        /// <summary>
        /// 用户部门树形结构
        /// </summary>
        /// <param name="ParentId"></param>
        /// <returns></returns>
        Task<ApiResult<List<UserDeptItemTree>>> GetUserDeptTree(int ParentId = 0);
        /// <summary>
        /// 修改部门状态
        /// </summary>
        /// <param name="deptId"></param>
        /// <returns></returns>
        Task<ApiResult> UpdateStateDeptAsync(int deptId);
    }
}
